package router

import (
	"exam/6.11/api/controller"
	"exam/6.11/global"
	"exam/6.11/initialize"
	"exam/6.11/model/dao"
	"exam/6.11/service"
	"github.com/gin-gonic/gin"
)

func InitRouter() *gin.Engine {
	engine := gin.Default()
	initialize.Viper()
	initialize.Nacos()
	initialize.Mysql()
	initialize.Redis()
	group := engine.Group("api")
	{
		controller := controller.NewOtherController(service.NewIOtherService(dao.NewOtherDao(global.GLO_DB)))
		group.GET("/find", controller.SupplierList)

		group.POST("/supplier_create", controller.SupplierCreate)
	}
	return engine
}
